#include <iostream>
#include <stack>
using namespace std;

int main()
{
	stack<char> s;
	char c;
	while (cin >> c) {
		if (s.size() && s.top() == c) s.pop();
		else s.push(c);
	}
	stack<char> tmp;
	while (s.size()) tmp.push(s.top()), s.pop();
	while (tmp.size()) {
		cout << tmp.top(); tmp.pop();
	}
	return 0;
}